import {
    createApp
} from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import http from './utils/request';
import * as echarts from 'echarts'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'dayjs/locale/zh-cn' //中文
import locale from 'element-plus/lib/locale/lang/zh-cn' //中文
import '@icon-park/vue-next/styles/index.css';
import {
    IconPark
} from '@/plugins/iconPark'
import util from './utils/util'
import './plugins/rem.js'
const app = createApp(App)
app.use(store).use(router).use(ElementPlus, { locale }).mount("#app");

IconPark(app)
// 工具函数导入
Object.keys(util).map((v) => {
    if (!app.config.globalProperties[v]) {
        app.config.globalProperties[v] = util[v]
    } else {
        throw new Error(`试图在给Vue的原型添加属性时候出现冲突,具体方法名为${v}`)
    }
})
app.config.globalProperties.$echarts = echarts;
app.config.globalProperties.$http = http;